import request from "../utils/request";
// 所有关于课程的接口
export function _addCourse(data) {
  return request("/VueHandler/CourseHandler?action=add", "post", data);
}
// 课程信息请求接口
export function _getCourse(ID) {
  return request("/VueHandler/CourseHandler?action=getcourse", "get", {
    ID: ID,
  });
}
// 添加目录接口
export function _addDir(data) {
  return request("/VueHandler/CourseHandler?action=AddDirectory", "post", data);
}
// 删除目录接口
export function _delDir(_id, CDid) {
  return request("/VueHandler/CourseHandler?action=deleteDirectory", "get", {
    _id: _id, //目录的_id
    CDid: CDid, //课程_id
  });
}
// 编辑目录接口
export function _EditDir(data) {
  return request(
    "/VueHandler/CourseHandler?action=updateDirectory",
    "post",
    data
  );
}
// 给对应目录添加视频接口
/**
 * 
cid  课程_id 
_id   目录_id
Vid  视频的_id
 */
export function _addDirVideo(data) {
  return request("/VueHandler/CourseHandler?action=addvideo", "get", data);
}
//获取目录下的视频
export function _getDirVideo(data) {
  return request("/VueHandler/VideoHandler?action=showdir", "get", data);
}

// 整体课程提交
export function _SaveAll(data) {
  return request("/VueHandler/CourseHandler?action=update", "post", data);
}
